<?php $this->page_title = $this->translate ( 'Received messages' ) ;?>

<div id="main_messages" class="span-24 last main">
    <div class="span-18">
        <div class="section_messages">
            <h2><?=$this->translate ( 'Received messages' );?></h2>

            <?  if (count ( $this->mensajes ) > 0) {
                        echo '<div class="success"><h2>';
                        foreach ( $this->mensajes as $msg ) {
                        echo $msg . '<br>';
                    }
                    echo '</h2></div>';
                }
            ?>

            <div class="user_profile">

                <?php
                //Zend_Debug::dump($this->listmessages);
                if ($this->listmessages): ?>
    
           <?php foreach ($this->paginator as $key => $val): ?>
                <div class="message_excerpt">
                            <a href="/<?=$this->lang ?>/message/delete/id/<?=$this->escape($val['id']) ?>">
                                <img alt="<?=$this->translate('Delete this message')?>" src="/images/icons/ico_delete_email.png" />
                            </a>
                            <?php
                    if ($val['readed'] == 0) {
                      echo '<img alt="'.$this->translate('unreaded').'" src="/images/icons/ico_unreaded_email.png" width="24" height="16" />';
                  } ?>
                                                  
                <a class="message_show_link" href="/<?=$this->lang ?>/message/show/id/<?=$this->escape($val['id']) ?>/subject/<?=$this->escape($val['subject']) ?>">
                   <?=$this->escape($val['subject']) ?></a>
              
                <span class="ad_date"> > <?=$this->translate('Sent at'). $this->escape(date( $this->translate('l dS \o\f F Y H:i:s'), strtotime($val['date_created']))) ?>
                <?=$this->translate('from user') ?>
    
                <a class="message_excerpt_link" href="/<?=$this->lang ?>/profile/<?=$this->escape($val['username']) ?>"><?=$this->escape($val['username']) ?></a>
                </span>
                
    
                    </div>
            <?php endforeach; ?>
           <?php endif; ?>
        </div>
        
            <?php echo $this->paginationControl($this->paginator,
                                        'Sliding',
                      'partials/paginator_ads.phtml'); ?>
        </div>    
    </div>
    
    <div class="span-6 last">
            
            <div class="received_messages_icon">
                <a class="received_messages" id="<?=(preg_match("/received/", $_SERVER['REQUEST_URI']))?"tab_active":"lala"?>" href="/<?=$this->lang ?>/message/received">
                    <img alt="<?=$this->translate('Received messages') ?>" src="/images/icons/ico_received_messages.png" class="valign" /><div class="txt_valign"><?=$this->translate('Received messages');?></div></a>
          </div>
            <div class="sent_messages_icon">
                <a class="sent_messages" id="<?=(preg_match("/sent/", $_SERVER['REQUEST_URI']))?"tab_active":"lala"?>" href="/<?=$this->lang ?>/message/sent">
                    <img alt="<?=$this->translate('Sent messages') ?>" src="/images/icons/ico_sent_messages.png" class="valign" /><div class="txt_valign"><?=$this->translate('Sent messages');?></div></a>        
            </div>
        <div class="clearer"></div>
        <div class="advertising">
                <!-- BEGIN PARTNER PROGRAM - DO NOT CHANGE THE PARAMETERS OF THE HYPERLINK -->
                <script language="javascript" type="text/javascript" src="http://program.epartner.es/view.asp?ref=570686&site=8346&type=html&hnb=5&js=1"></script>
                <noscript><a href="http://web.epartner.es/click.asp?ref=570686&site=8346&type=b1&bnb=1" target="_blank">
                <img src="http://program.epartner.es/view.asp?ref=570686&site=8346&b=1" border="0"/></a><br /></noscript>
                <!-- END PARTNER PROGRAM -->
        </div>
    </div>
</div> <!-- /main -->